package com.jeecg.p3.dzdp.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import org.jeecgframework.p3.core.utils.common.PageList;
import org.jeecgframework.p3.core.utils.common.PageQuery;
import org.jeecgframework.p3.core.utils.common.Pagenation;
import com.jeecg.p3.dzdp.service.WxActDzdpBasicService;
import com.jeecg.p3.dzdp.entity.WxActDzdpBasic;
import com.jeecg.p3.dzdp.dao.WxActDzdpBasicDao;

@Service("wxActDzdpBasicService")
public class WxActDzdpBasicServiceImpl implements WxActDzdpBasicService {
	@Resource
	private WxActDzdpBasicDao wxActDzdpBasicDao;

	@Override
	public void doAdd(WxActDzdpBasic wxActDzdpBasic) {
		wxActDzdpBasicDao.add(wxActDzdpBasic);
	}

	@Override
	public void doEdit(WxActDzdpBasic wxActDzdpBasic) {
		wxActDzdpBasicDao.update(wxActDzdpBasic);
	}

	@Override
	public void doDelete(String id) {
		wxActDzdpBasicDao.delete(id);
	}

	@Override
	public WxActDzdpBasic queryById(String id) {
		WxActDzdpBasic wxActDzdpBasic  = wxActDzdpBasicDao.get(id);
		return wxActDzdpBasic;
	}

	@Override
	public PageList<WxActDzdpBasic> queryPageList(
		PageQuery<WxActDzdpBasic> pageQuery) {
		PageList<WxActDzdpBasic> result = new PageList<WxActDzdpBasic>();
		Integer itemCount = wxActDzdpBasicDao.count(pageQuery);
		List<WxActDzdpBasic> list = wxActDzdpBasicDao.queryPageList(pageQuery,itemCount);
		Pagenation pagenation = new Pagenation(pageQuery.getPageNo(), itemCount, pageQuery.getPageSize());
		result.setPagenation(pagenation);
		result.setValues(list);
		return result;
	}

	@Override
	public List<WxActDzdpBasic> queryBasics(String jwid) {
		
		return wxActDzdpBasicDao.queryBasics(jwid);
	}
	
	
}
